Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't merge buffers if final buffer exceeds fs.write maximum of 2147479552 bytes #280

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

lilleyse
Copy link
Contributor

We have a couple areas in obj2gltf and gltf-pipeline that prevent merging buffers if the combined buffer would be greater than Node's maximum buffer size. This size was increased to 4,294,967,296 (2^32) bytes a little while back for 64-bit platforms.

The problem is fs.write has a separate maximum of 2,147,479,552 bytes which is the limit of the Linux write syscall. Node will throw an error if the buffer being written is greater than that value (actually, it checks if the value is a valid Int32 which is a slightly larger value).

So really we need to observe the fs.write limit.

See also: CesiumGS/gltf-pipeline#627

@lilleyse lilleyse changed the title Don't merge buffers if final buffer exceeds fs.write maximum of 2147479552 bytes Don't merge buffers if final buffer exceeds fs.write maximum of 2147479552 bytes Jan 25, 2023
@mramato mramato merged commit 81f6d53 into main Jan 25, 2023
@mramato mramato deleted the reduce-max-buffer-length branch January 25, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants